package com.jqk.apipassener.feign;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author:jiangqikun
 * @Date:2022/3/11 20:45
 **/
@Component
public class ProviderFallBackFactory implements FallbackFactory<ProviderFeign> {

    @Override
    public ProviderFeign create(Throwable cause) {

        return new ProviderFeign() {
            @Override
            public String sendMessage() {
                return "调用 sendMessage 方法失败";
            }

            @Override
            public String testHystrix() {
                return "调用 testHystrix 方法失败";
            }

            @Override
            public String testTime() {return "调用 testHystrix 方法失败";}
        };
    }
}
